package cn.relx.basic.util;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;
@Data
@NoArgsConstructor
public class PageList<T> {

    // 总条数
    private Integer totals = 0;

    // 总数据 result.data.data
    private List<T> rows = new ArrayList<>();

    @Override
    public String toString() {
        return "PageList{" +
                "totals=" + totals +
                ", rows=" + rows +
                '}';
    }

    public Integer getTotals() {
        return totals;
    }

    public void setTotals(Integer totals) {
        this.totals = totals;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public PageList(Integer totals, List<T> rows) {
        this.totals = totals;
        this.rows = rows;
    }

}
